<!--  -->
<template>
  <div class="goods-item" @click="itemClick">
      <img :src="goodsItem.show.img" alt="">
      <div>
          <p>{{goodsItem.title}}</p>
          <span class="price">￥{{goodsItem.price}}</span>
          <span class="collect">收藏：{{goodsItem.cfav}}</span>
      </div>
  </div>
</template>

<script>
export default {
    props:{
        goodsItem:{
            type:Object,
            default(){
                return{}
            }
        }
    },
    methods:{
        itemClick(){
        this.$router.push({path:`/detail/${this.goodsItem.iid}`})
        }
    }
}

</script>
<style scoped>
.goods-item img{
    width: 100%;
    height: 200px;
}
.goods-item p{
   width: 156px;
    font-size: 13px;
      overflow: hidden;
    text-overflow:ellipsis;
    white-space: nowrap;
}
.goods-item span{
    margin:6px;
    font-size: 12px;
}
</style>